﻿using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Mvc.RazorTools.FontAwesome.Tests
{
	[TestClass]
	public class FontAwesomeStackTests
	{
		[TestMethod]
		[TestCategory("FontAwesomeStackTests")]
		public void FontAwesomeStackConstructorTest1()
		{
			FontAwesomeStack stack = new FontAwesomeStack(FontAwesomeIconSet.Star);
			Assert.AreEqual("<span class=\"fa-stack\"><i class=\"fa fa-star fa-stack-1x\"></i></span>", stack.Html.ToString());
		}

		[TestMethod]
		[TestCategory("FontAwesomeStackTests")]
		public void FontAwesomeStackConstructorTest2()
		{
			Dictionary<string, string> classAttributes = new Dictionary<string, string>();
			classAttributes.Add("item1", "value1");
			classAttributes.Add("item2", "value2");
			classAttributes.Add("item3", "value3");

			FontAwesomeStack stack = new FontAwesomeStack(FontAwesomeIconSet.Star, classAttributes);
			Assert.AreEqual("<span class=\"fa-stack value1 value2 value3\"><i class=\"fa fa-star fa-stack-1x\"></i></span>", stack.Html.ToString());
		}

		[TestMethod]
		[TestCategory("FontAwesomeStackTests")]
		public void FontAwesomeStackConstructorTest3()
		{
			FontAwesomeStack stack = new FontAwesomeStack(
						FontAwesomeIconSet.Star,
						FontAwesomeIconSet.Flag);

			Assert.AreEqual("<span class=\"fa-stack\"><i class=\"fa fa-star fa-stack-1x\"></i><i class=\"fa fa-flag fa-stack-1x\"></i></span>", stack.Html.ToString());
		}

		[TestMethod]
		[TestCategory("FontAwesomeStackTests")]
		public void FontAwesomeStackConstructorTest4()
		{
			Dictionary<string, string> classAttributes = new Dictionary<string, string>();
			classAttributes.Add("item1", "value1");
			classAttributes.Add("item2", "value2");
			classAttributes.Add("item3", "value3");

			FontAwesomeStack stack = new FontAwesomeStack(
						FontAwesomeIconSet.Star,
						FontAwesomeIconSet.Flag,
						classAttributes);

			Assert.AreEqual("<span class=\"fa-stack value1 value2 value3\"><i class=\"fa fa-star fa-stack-1x\"></i><i class=\"fa fa-flag fa-stack-1x\"></i></span>", stack.Html.ToString());
		}

		[TestMethod]
		[TestCategory("FontAwesomeStackTests")]
		public void FontAwesomeStackConstructorTest5()
		{
			FontAwesomeStack stack = new FontAwesomeStack(
						FontAwesomeIconSet.Star,
						FontAwesomeIconSet.Flag,
						FontAwesomeIconSet.Fire);

			Assert.AreEqual("<span class=\"fa-stack\"><i class=\"fa fa-star fa-stack-1x\"></i><i class=\"fa fa-flag fa-stack-1x\"></i><i class=\"fa fa-fire fa-stack-1x\"></i></span>", stack.Html.ToString());
		}

		[TestMethod]
		[TestCategory("FontAwesomeStackTests")]
		public void FontAwesomeStackConstructorTest6()
		{
			Dictionary<string, string> classAttributes = new Dictionary<string, string>();
			classAttributes.Add("item1", "value1");
			classAttributes.Add("item2", "value2");
			classAttributes.Add("item3", "value3");

			FontAwesomeStack stack = new FontAwesomeStack(
						FontAwesomeIconSet.Star,
						FontAwesomeIconSet.Flag,
						FontAwesomeIconSet.Fire,
						classAttributes);

			Assert.AreEqual("<span class=\"fa-stack value1 value2 value3\"><i class=\"fa fa-star fa-stack-1x\"></i><i class=\"fa fa-flag fa-stack-1x\"></i><i class=\"fa fa-fire fa-stack-1x\"></i></span>", stack.Html.ToString());
		}

		[TestMethod]
		[TestCategory("FontAwesomeStackTests")]
		public void FontAwesomeStackConstructorTest7()
		{
			FontAwesomeStack stack = new FontAwesomeStack(new FontAwesomeIcon[] { FontAwesomeIconSet.Star, FontAwesomeIconSet.Flag, FontAwesomeIconSet.Fire });
			Assert.AreEqual("<span class=\"fa-stack\"><i class=\"fa fa-star fa-stack-1x\"></i><i class=\"fa fa-flag fa-stack-1x\"></i><i class=\"fa fa-fire fa-stack-1x\"></i></span>", stack.Html.ToString());
		}

		[TestMethod]
		[TestCategory("FontAwesomeStackTests")]
		public void FontAwesomeStackConstructorTest8()
		{
			Dictionary<string, string> classAttributes = new Dictionary<string, string>();
			classAttributes.Add("item1", "value1");
			classAttributes.Add("item2", "value2");
			classAttributes.Add("item3", "value3");

			FontAwesomeStack stack = new FontAwesomeStack(
						new FontAwesomeIcon[] 
						{ 
							FontAwesomeIconSet.Star, 
							FontAwesomeIconSet.Flag, 
							FontAwesomeIconSet.Fire 
						},
						classAttributes);


			Assert.AreEqual("<span class=\"fa-stack value1 value2 value3\"><i class=\"fa fa-star fa-stack-1x\"></i><i class=\"fa fa-flag fa-stack-1x\"></i><i class=\"fa fa-fire fa-stack-1x\"></i></span>", stack.Html.ToString());
		}

		[TestMethod]
		[TestCategory("FontAwesomeStackTests")]
		public void FontAwesomeStackConstructorTest9()
		{
			FontAwesomeStack stack = new FontAwesomeStack(
						new FontAwesomeIcon[]
						{
							FontAwesomeIconSet.Star, 
							FontAwesomeIconSet.Flag, 
							FontAwesomeIconSet.Fire 
						},
						new string[]
						{ 
							"value1", 
							"value2", 
							"value3" 
						});

			Assert.AreEqual("<span class=\"fa-stack value1 value2 value3\"><i class=\"fa fa-star fa-stack-1x\"></i><i class=\"fa fa-flag fa-stack-1x\"></i><i class=\"fa fa-fire fa-stack-1x\"></i></span>", stack.Html.ToString());
		}

		[TestMethod]
		[TestCategory("FontAwesomeStackTests")]
		public void FontAwesomeStackItemsTest()
		{
			FontAwesomeStack stack = new FontAwesomeStack(
						new FontAwesomeIcon[] 
						{ 
							FontAwesomeIconSet.Star, 
							FontAwesomeIconSet.Flag, 
							FontAwesomeIconSet.Fire 
						});

			Assert.AreEqual(3, stack.Items.Count());
			Assert.AreSame(FontAwesomeIconSet.Star, stack.Items[0]);
			Assert.AreSame(FontAwesomeIconSet.Flag, stack.Items[1]);
			Assert.AreSame(FontAwesomeIconSet.Fire, stack.Items[2]);
		}

		[TestMethod]
		[TestCategory("FontAwesomeStackTests")]
		public void FontAwesomeStackCloneTest1()
		{
			Dictionary<string, string> classAttributes = new Dictionary<string, string>();
			classAttributes.Add("item1", "value1");
			classAttributes.Add("item2", "value2");
			classAttributes.Add("item3", "value3");

			FontAwesomeStack stack1 = new FontAwesomeStack(new FontAwesomeIcon[] { FontAwesomeIconSet.Star, FontAwesomeIconSet.Flag }, classAttributes);
			object stack2 = stack1.Clone();

			Assert.IsInstanceOfType(stack2, typeof(FontAwesomeStack));
			Assert.AreNotSame(stack1, stack2);
			Assert.AreEqual(stack1.ClassAttributes.Count(), ((FontAwesomeStack)stack2).ClassAttributes.Count());
			Assert.AreEqual(stack1.Html.ToString(), ((FontAwesomeStack)stack2).Html.ToString());
			Assert.AreEqual(stack1.Items.Count(), ((FontAwesomeStack)stack2).Items.Count());
		}

		[TestMethod]
		[TestCategory("FontAwesomeStackTests")]
		public void FontAwesomeStackCloneTest2()
		{

		}
	}
}
